import time
seconds=time.time()

def cortirovka(nums):
    s=True
    while s:
        s=False
        for i in range(len(nums)-1):
            if nums[i] > nums[i+1]:
                nums[i], nums[i+1] = nums[i+1], nums[i]
                s=True
                
def chtenie(filename):
    file = open(filename, 'r')
    data= file.readlines()
    return data
m1=chtenie("m1_sorted.txt")
m2=chtenie("m2_reverse.txt")
m3=chtenie("m3_shuffle.txt")

nachalo=time.time()
cortirovka(m1)
konech=time.time()
print("m1_sorted" ,round((konech-nachalo)*1000), "milliseconds")

nachalo=time.time()
cortirovka(m2)
konech=time.time()
print("m2_reverse" ,round((konech-nachalo)*1000), "milliseconds")


nachalo=time.time()
cortirovka(m3)
konech=time.time()
print("m3_suffle" ,round((konech-nachalo)*1000), "milliseconds")
